import { ApiProperty } from '@nestjs/swagger';
import {
  IsNotEmpty,
  IsOptional,
  IsDateString,
  IsEmail,
  IsByteLength,
  IsEnum,
} from 'class-validator';
import { groupStatusEnum } from '../entity/group.entity';

export class UpdateGroupDto {
  @ApiProperty({ description: '群组uuid', required: true })
  @IsOptional()
  @IsByteLength(0, 36)
  readonly group_id?: string;

  @ApiProperty({ description: '群组所属用户id', required: true })
  @IsOptional()
  readonly creator_uid?: number;

  @ApiProperty({ description: '群组名称', required: true })
  @IsOptional()
  @IsByteLength(0, 48)
  readonly group_name?: string;

  @ApiProperty({
    description: '群组头像',
    required: true,
    default: 'default_assets/default_group_avatar.jpg',
  })
  @IsOptional()
  @IsByteLength(0, 120)
  readonly group_avatar?: string;

  @ApiProperty({ description: '群组简介', required: false })
  @IsOptional()
  readonly group_introduce?: string;

  @ApiProperty({ description: '群状态', required: true, default: 'normal' })
  @IsOptional()
  @IsEnum(groupStatusEnum)
  readonly group_status?: string;
}
